﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="mm_detailsview.aspx.cs" Inherits="RGPWEB.admin.Hjbom.mm_detailsview" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
    
    <link href="../../inc/Style/index.css" rel="stylesheet" type="text/css" />
    <link href="../../inc/Style/childindex.css" rel="stylesheet" type="text/css" />
    <link href="../../inc/Style/GridView.css" rel="stylesheet" type="text/css" />
    
    
    <script type="text/javascript">
    
      function pageLoad() {
      }
    
    </script>
    <style type="text/css">
        #apDiv1
        {
            width: 946px;
            top: 65px;
            left: 5px;
            margin-bottom: 0px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <asp:Panel ID="TitlePanel" runat="server" CssClass="titlePadding" Height="21px" 
        Width="939px">
        物料详细信息
    </asp:Panel>
    
    
    
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
    </div>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    </asp:UpdatePanel>
    

    
    <div id="apDiv1" dir="ltr" style="position: fixed; height: 336px;">
        <asp:DetailsView ID="DV_mm" runat="server" Height="56px" Width="100%" 
            AutoGenerateRows="False" DataSourceID="SDS_DV_mm" BackColor="White" 
            BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4" 
            ForeColor="Black" GridLines="Vertical">
            <FooterStyle BackColor="#CCCC99" />
            <RowStyle BackColor="#F7F7DE" />
            <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
            <Fields>
                <asp:BoundField DataField="料号" HeaderText="料号" SortExpression="料号" />
                <asp:BoundField DataField="名称" HeaderText="名称" SortExpression="名称" />
                <asp:BoundField DataField="规格" HeaderText="规格" SortExpression="规格" />
                <asp:BoundField DataField="备注" HeaderText="备注" SortExpression="备注" />
                <asp:BoundField DataField="辅助属性" HeaderText="辅助属性" SortExpression="辅助属性" />
                <asp:BoundField DataField="全名" HeaderText="全名" SortExpression="全名" />
                <asp:BoundField DataField="BOM单号" HeaderText="BOM单号" SortExpression="BOM单号" />
                <asp:HyperLinkField DataNavigateUrlFields="BOM单号" 
                    DataNavigateUrlFormatString="mm_detailsview.aspx?BOM单号={0}" 
                    DataTextField="BOM单号" DataTextFormatString="查询{0}详细信息" />
            </Fields>
            <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="White" />
        </asp:DetailsView>
        <asp:SqlDataSource ID="SDS_DV_mm" runat="server" 
            ConnectionString="<%$ ConnectionStrings:AIS20101102153154ConnectionString %>" 
            
            SelectCommand="SELECT t_ICItem.FNumber AS 料号, t_ICItem.FName AS 名称, t_ICItem.FModel AS 规格, t_ICItem.FNote AS 备注, vwItemAuxProp.FName AS 辅助属性, t_ICItem.FFullName AS 全名, ICBOM.FBOMNumber AS BOM单号 FROM t_ICItem LEFT OUTER JOIN ICBOM ON t_ICItem.FItemID = ICBOM.FItemID LEFT OUTER JOIN vwItemAuxProp ON t_ICItem.FAuxClassID = vwItemAuxProp.FItemID WHERE (t_ICItem.FDeleted &lt;&gt; 1) AND (t_ICItem.FNumber = @FNumber_P) ORDER BY t_ICItem.FNumber">
            <SelectParameters>
                <asp:QueryStringParameter Name="FNumber_P" QueryStringField="料号" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:GridView ID="GV_Bom" runat="server" AutoGenerateColumns="False" 
            BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" 
            CellPadding="4" DataSourceID="SDS_GV_bom" ForeColor="Black" 
            GridLines="Vertical" Width="100%">
            <RowStyle BackColor="#F7F7DE" />
            <Columns>
                <asp:BoundField DataField="顺序号" HeaderText="顺序号" SortExpression="顺序号" />
                <asp:HyperLinkField DataNavigateUrlFields="FItemID" 
                    DataNavigateUrlFormatString="mm_detailsview.aspx?FItemID={0}" 
                    DataTextField="FItemID" DataTextFormatString="详细">
                    <ItemStyle Width="30px" />
                </asp:HyperLinkField>
                <asp:BoundField DataField="物料代码" HeaderText="物料代码" SortExpression="物料代码" />
                <asp:BoundField DataField="物料名称" HeaderText="物料名称" SortExpression="物料名称" />
                <asp:BoundField DataField="规格型号" HeaderText="规格型号" SortExpression="规格型号" />
                <asp:BoundField DataField="用量" HeaderText="用量" SortExpression="用量" />
                <asp:BoundField DataField="单位" HeaderText="单位" SortExpression="单位" />
                <asp:BoundField DataField="使用状态" HeaderText="使用状态" SortExpression="使用状态" />
                <asp:BoundField DataField="发料仓库" HeaderText="发料仓库" SortExpression="发料仓库" />
                <asp:BoundField DataField="备注" HeaderText="备注" SortExpression="备注" />
            </Columns>
            <FooterStyle BackColor="#CCCC99" />
            <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
            <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
        <asp:SqlDataSource ID="SDS_GV_bom" runat="server" 
            ConnectionString="<%$ ConnectionStrings:AIS20101102153154ConnectionString %>" 
            SelectCommand="SELECT FEntryID AS 顺序号, FNumber AS 物料代码, fitemname AS 物料名称, FModel AS 规格型号, FQty AS 用量, funitid AS 单位, fusestate AS 使用状态, fstockid AS 发料仓库, FNote AS 备注, FItemID FROM (SELECT a.FEntryID, a.FInterID, b.FItemID, b.FNumber, b.FName AS fitemname, b.FModel, d.FName AS fbaseunitid, w.FName AS funitid, e.FName AS fmaterieltype, f.FName AS fmarshaltype, a.FAuxQty, a.FQty, a.FScrap, a.FBeginDay, a.FEndDay, a.FPercent, (CASE a.fopersn WHEN 0 THEN '' ELSE CAST(a.fopersn AS VARCHAR(255)) END) AS fopersn, j.FName AS foperid, a.FMachinePos, a.FOffSetDay, CASE a.fbackflush WHEN 1059 THEN '否' ELSE '是' END AS fbackflush, CASE b.fiskeyitem WHEN 0 THEN '否' ELSE '是' END AS fiskeyitem, CASE h.fdeleted WHEN 0 THEN '否' ELSE '是' END AS fforbituse, g.FName AS fusestate, CASE i.fspid WHEN 0 THEN '' ELSE i.fname END AS fspid, c.FName AS fstockid, a.FNote, b.FQtyDecimal, v.FName AS ferpclsname, zz.fplanprice FROM ICBOM AS a1 INNER JOIN ICBOMChild AS a ON a1.FInterID = a.FInterID INNER JOIN t_ICItem AS b ON a.FItemID = b.FItemID LEFT OUTER JOIN (SELECT FItemID, FName FROM t_Stock UNION SELECT 0 AS fitemid, '' AS fname) AS c ON ISNULL(a.FStockID, 0) = c.FItemID LEFT OUTER JOIN t_MeasureUnit AS d ON b.FUnitID = d.FItemID LEFT OUTER JOIN t_SubMessage AS e ON a.FMaterielType = e.FInterID LEFT OUTER JOIN t_SubMessage AS f ON a.FMarshalType = f.FInterID LEFT OUTER JOIN t_SubMessage AS g ON b.FUseState = g.FInterID LEFT OUTER JOIN t_Item AS h ON b.FItemID = h.FItemID LEFT OUTER JOIN t_StockPlace AS i ON a.FSPID = i.FSPID LEFT OUTER JOIN t_SubMessage AS j ON a.FOperID = j.FInterID AND j.FTypeID = 61 LEFT OUTER JOIN t_MeasureUnit AS w ON a.FUnitID = w.FItemID LEFT OUTER JOIN t_SubMessage AS v ON b.FErpClsID = v.FInterID LEFT OUTER JOIN aprice AS zz ON zz.fitemid = a.FItemID WHERE (a.FInterID IN (SELECT FInterID FROM ICBOM AS zz WHERE (FBOMNumber = @Fbomnumber_P)))) AS tt ORDER BY FEntryID">
            <SelectParameters>
                <asp:QueryStringParameter Name="Fbomnumber_P" QueryStringField="BOM单号" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:GridView ID="GV_SubBom" runat="server" AutoGenerateColumns="False" 
            BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" 
            CellPadding="4" DataSourceID="SDS_GV_Subbom" ForeColor="Black" 
            GridLines="Vertical" Width="100%">
            <RowStyle BackColor="#F7F7DE" />
            <Columns>
                <asp:BoundField DataField="顺序号" HeaderText="顺序号" SortExpression="顺序号" />
                <asp:BoundField DataField="物料代码" HeaderText="物料代码" SortExpression="物料代码" />
                <asp:BoundField DataField="物料名称" HeaderText="物料名称" SortExpression="物料名称" />
                <asp:BoundField DataField="规格型号" HeaderText="规格型号" SortExpression="规格型号" />
                <asp:BoundField DataField="用量" HeaderText="用量" SortExpression="用量" />
                <asp:BoundField DataField="单位" HeaderText="单位" SortExpression="单位" />
                <asp:BoundField DataField="使用状态" HeaderText="使用状态" SortExpression="使用状态" />
                <asp:BoundField DataField="发料仓库" HeaderText="发料仓库" SortExpression="发料仓库" />
                <asp:BoundField DataField="备注" HeaderText="备注" SortExpression="备注" />
                <asp:BoundField DataField="fitemid" HeaderText="fitemid" 
                    SortExpression="fitemid" Visible="False" />
                <asp:BoundField DataField="finterid" HeaderText="finterid" 
                    SortExpression="finterid" Visible="False" />
            </Columns>
            <FooterStyle BackColor="#CCCC99" />
            <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
            <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
        <asp:SqlDataSource ID="SDS_GV_Subbom" runat="server" 
            ConnectionString="<%$ ConnectionStrings:AIS20101102153154ConnectionString %>" SelectCommand="SELECT tt.fentryid AS &quot;顺序号&quot;,
       tt.fnumber AS &quot;物料代码&quot;,
       tt.fitemname AS &quot;物料名称&quot;,
       tt.fmodel AS &quot;规格型号&quot;,
       tt.fqty AS &quot;用量&quot;,
       tt.funitid AS &quot;单位&quot;,
       tt.fusestate AS &quot;使用状态&quot;,
       tt.fstockid AS &quot;发料仓库&quot;,
       tt.fnote AS &quot;备注&quot;,
       tt.fitemid,
       tt.finterid
       --tt.fplanprice as &quot;价格&quot;,
       --tt.fplanprice*tt.fqty as &quot;核算&quot;
FROM   (SELECT a.fentryid,
               a.finterid,
               b.fitemid,
               b.fnumber,
               b.fname AS fitemname,
               b.fmodel,
               d.fname AS fbaseunitid,
               w.fname AS funitid,
               e.fname AS fmaterieltype,
               f.fname AS fmarshaltype,
               a.fauxqty,
               a.fqty,
               a.fscrap,
               a.fbeginday,
               a.fendday,
               a.fpercent,
               (CASE a.fopersn 
                  WHEN 0 THEN ''
                  ELSE CAST(a.fopersn AS 
VARCHAR(255))
                END) fopersn,
               j.fname AS foperid,
               a.fmachinepos,
               a.foffsetday,
               CASE a.fbackflush 
                 WHEN 1059 THEN '否'
                 ELSE '是'
               END AS fbackflush,
               CASE b.fiskeyitem 
                 WHEN 0 THEN '否'
                 ELSE '是'
               END AS fiskeyitem,
               CASE h.fdeleted 
                 WHEN 0 THEN '否'
                 ELSE '是'
               END AS fforbituse,
               g.fname AS fusestate,
               CASE i.fspid 
                 WHEN 0 THEN ''
                 ELSE i.fname
               END AS fspid,
               c.fname AS fstockid,
               a.fnote,
               b.fqtydecimal,
               v.fname AS ferpclsname,
              zz.fplanprice
        FROM   icbom a1
               INNER JOIN icbomchild a
                 ON a1.finterid = a.finterid
               INNER JOIN t_icitem b
                 ON a.fitemid = b.fitemid
               LEFT JOIN (SELECT fitemid,
                                 fname
                          FROM   t_stock
                          UNION 
                          SELECT 0 AS fitemid,
                                 '' AS fname) c
                 ON Isnull(a.fstockid,0) = 
c.fitemid
               LEFT JOIN t_measureunit d
                 ON b.funitid = d.fitemid
               LEFT JOIN t_submessage e
                 ON a.fmaterieltype = 
e.finterid
               LEFT JOIN t_submessage f
                 ON a.fmarshaltype = f.finterid
               LEFT JOIN t_submessage g
                 ON b.fusestate = g.finterid
               LEFT JOIN t_item h
                 ON b.fitemid = h.fitemid
               LEFT JOIN t_stockplace i
                 ON a.fspid = i.fspid
               LEFT JOIN t_submessage j
                 ON a.foperid = j.finterid
                    AND j.ftypeid = 61
               LEFT JOIN t_measureunit w
                 ON a.funitid = w.fitemid
               LEFT JOIN t_submessage v
                 ON b.ferpclsid = v.finterid
               LEFT JOIN aprice zz
              ON zz.fitemid=a.fitemid
             where a.finterid in 

(SELECT zz.finterid

from icbom zz where zz.fitemid=

@Fitemid_P)) tt order by tt.fentryid">
            <SelectParameters>
                <asp:QueryStringParameter Name="Fitemid_P" QueryStringField="FItemID" />
            </SelectParameters>
        </asp:SqlDataSource>
        <br />
        <br />
    </div>


    
    </form>
</body>

    


</html>
